/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1687684654851_4075';
 //生成token
 config.jwt  = {
  secret: "haoxing" //秘钥
};
  // add your middleware config here
  // config.middleware = [];
  // config.mongoose = {
  //   url: process.env.EGG_MONGODB_URL || 'mongodb://zx:cjX8N5NaMR6biXFp@211.159.163.63:27017/zx',
  //   options: {
  //     server: {
  //       poolSize: 40,
  //     },
  //   },
  // };
  // config.default.js
// 跨域设置
config.security = {
  csrf: {
    enable: false
  },
  domainWhiteList: [ '*' ]
};
config.cors = {
  origin: '*',
  allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH,OPTIONS'
};
  config.logger = {
    level: 'INFO',
    dir: '/home/log/dir',
  };
  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
  };

  return {
    ...config,
    ...userConfig,
  };
};
